export  function timeChange(originval) {
    const dt =new Date(originval)

    const y =dt.getFullYear()
    const m=(dt.getMonth()+1 +'').padStart(2,'0')
    const d =(dt.getDate()+'').padStart(2,'0')

    const hh =(dt.getHours()+'').padStart(2,'0')
    const mm =(dt.getMinutes()+'').padStart(2,'0')
    const ss =(dt.getSeconds()+'').padStart(2,'0')
    return `${y}-${m}-${d}`
}

export function  timeForData(originval) {
    const dt =new Date(originval)

    const y =dt.getFullYear()
    const m=(dt.getMonth()+1 +'').padStart(2,'0')
    const d =(dt.getDate()+'').padStart(2,'0')

    const hh =(dt.getHours()+'').padStart(2,'0')
    const mm =(dt.getMinutes()+'').padStart(2,'0')
    const ss =(dt.getSeconds()+'').padStart(2,'0')
    return `${y}/${m}/${d} ${hh}:${mm}:${ss}`
}

export function  dateData(originval) {
    const dt =new Date(originval)
    const y =dt.getFullYear()
    const m=(dt.getMonth()+ 1 +'').padStart(2,'0')
    const d =(dt.getDate()+'').padStart(2,'0')

    const hh =(dt.getHours()+'').padStart(2,'0')
    const mm =(dt.getMinutes()+'').padStart(2,'0')
    const ss =(dt.getSeconds()+'').padStart(2,'0')
    return `${hh}:${mm}`
}
//手机号加密
export function changePhone(phone) {
        return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
      }

